package com.qingxin.ui.bean;

import org.codehaus.jackson.annotate.JsonIgnore;
import org.codehaus.jackson.map.annotate.JsonSerialize;

@JsonSerialize(include=JsonSerialize.Inclusion.NON_NULL)
public class UICenterTab extends UICenterTabNode {

	private UISearches searches;
	private UITable table;
	private UIRight right;
	
	public UICenterTab() {
	}
	
	
	public UICenterTab(String id, String name, String code, String title,
			String type, String url, String icon, String reload, String ignoreparam,
			String dynamic, UISearches searches) {
		super(id, name, code, title, type, url, icon, reload, ignoreparam, dynamic);
		this.searches = searches;
	}


	@JsonIgnore
	public UICenterTabNode getCenterTabNode(){
		return new UICenterTabNode(id, name, code, title, type, url, icon, reload, uiparam, dynamic);
	}
	
	@JsonIgnore
	public UICenterTab copy(){
		UICenterTab target = new UICenterTab(id, name, code, title, type, url, icon, reload, uiparam, dynamic, searches);
		
		if(table!=null){
			target.setTable(table.copy());
		}
		if(right!=null){
			target.setRight(right);
		}
		
		return target;
	}


	public UISearches getSearches() {
		return searches;
	}
	public void setSearches(UISearches searches) {
		this.searches = searches;
	}
	public UITable getTable() {
		return table;
	}
	public void setTable(UITable table) {
		this.table = table;
	}
	public UIRight getRight() {
		return right;
	}
	public void setRight(UIRight right) {
		this.right = right;
	}
	
}
